package dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.Window;

import com.sam.widget.R;

/**
 * Created by Administrator on 2016/6/15.
 */
public class CustomDialog extends Dialog {
    private View layoutView;
    protected Context context;

    public CustomDialog(Context context,int layouResId){
        this(context);
        this.context=context;
        getWindow().requestFeature(Window.FEATURE_NO_TITLE);
        getWindow().setBackgroundDrawableResource(android.R.color.transparent);
        layoutView=View.inflate(context,layouResId,null);
        setContentView(layoutView);
    }
     public CustomDialog(Context context) {
        super(context,android.R.style.Theme_Dialog);
    }

    @Override
    public View findViewById(int id) {
        if (layoutView==null) return super.findViewById(id);
        else return layoutView.findViewById(id);
    }
}
